how to count number of nodes in json